﻿using Cofe.Core.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core.Property
{
    /// <summary>
    /// IFileSystemInfo implementation do not store properties itself.
    /// It rely on various property providers to provide properties (e.g. FileName)
    /// </summary>
    public interface IPropertyProvider
    {
        /// <summary>
        /// Return a list of supported property definitions, not all property in the definitions is necessary supported.
        /// Use IsPropertySupported to make sure the property is supported.
        /// </summary>
        IPropertyDefinitions[] SupportedDefinitions { get; }

        /// <summary>
        /// Get whether the specified property is supported (at least read).
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        bool IsPropertySupported(object property);

        /// <summary>
        /// Get whether the specified property is read only.
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        bool IsPropertyReadOnly(object property);

        /// <summary>
        /// Return value of the specified property.
        /// </summary>        
        /// <param name="property"></param>
        /// <returns></returns>
        Task<PropertyPair[]> GetPropertyAsync(object property);

        /// <summary>
        /// Set value of the specified property.
        /// </summary>        
        /// <param name="property"></param>
        /// <returns></returns>
        Task<bool> SetPropertyAsync(PropertyPair propertyPair);

        /// <summary>
        /// Refresh all properties from the underlying refrence.
        /// </summary>
        Task RefreshAsync();


        IPropertyDictionary PropertyDictionary { get; set; }

    }
}
